package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


@Entity
@Table(name="FIELD")
public class Field {

	@Id
	@Column(name="id")
	@SequenceGenerator(name = "SecuenciaCampo", sequenceName = "seq_field", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SecuenciaCampo")
	private Integer ID;
	
	@Column(name="name")
	private String name;
	
	@Column(name="bit_type")
	private Boolean bitType;
	
	@Column(name="address")
	private Integer address;
	
	@Column(name="address_type")
	private AddressType addressType;
	
	@Column(name="bit_offset")
	private Integer bitOffset;
	
	@ManyToOne
	@JoinColumn(name="dev_type")
	private DeviceType deviceType;

	/**
	 * @return the iD
	 */
	public Integer getID() {
		return ID;
	}

	/**
	 * @param iD the iD to set
	 */
	public void setID(Integer iD) {
		ID = iD;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the bitType
	 */
	public Boolean getBitType() {
		return bitType;
	}

	/**
	 * @param bitType the bitType to set
	 */
	public void setBitType(Boolean bitType) {
		this.bitType = bitType;
	}

	/**
	 * @return the address
	 */
	public Integer getAddress() {
		return address;
	}

	/**
	 * @param address the address to set
	 */
	public void setAddress(Integer address) {
		this.address = address;
	}

	/**
	 * @return the addressType
	 */
	public AddressType getAddressType() {
		return addressType;
	}

	/**
	 * @param addressType the addressType to set
	 */
	public void setAddressType(AddressType addressType) {
		this.addressType = addressType;
	}

	/**
	 * @return the bitOrder
	 */
	public Integer getBitOffset() {
		return bitOffset;
	}

	/**
	 * @param bitOrder the bitOrder to set
	 */
	public void setBitOffset(Integer bitOffset) {
		this.bitOffset = bitOffset;
	}

	/**
	 * @return the deviceType
	 */
	public DeviceType getDeviceType() {
		return deviceType;
	}

	/**
	 * @param deviceType the deviceType to set
	 */
	public void setDeviceType(DeviceType deviceType) {
		this.deviceType = deviceType;
	}

	

}
